package uml.eventsystem.events;

/**
 * An enumeration of possible events used by the {@link uml.eventsystem event
 * system}.
 * 
 * @author A-Team
 * 
 */
public enum UMLEventId
{
	NULL(null),
	SYSTEM(NULL),
		APPLICATION_EXIT(SYSTEM),
		MAKE_ACTIVE (SYSTEM),
		MAKE_INACTIVE (SYSTEM),
		CREATE_DIAGRAM(SYSTEM),
		CLOSE_DIAGRAM (SYSTEM),
		PRINT(SYSTEM),
		REPAINT(SYSTEM),
		SAVE(SYSTEM),
		SAVEAS(SYSTEM),
		OPEN(SYSTEM),
		SHORTCUT_HELP (SYSTEM),
		ABOUT (SYSTEM),
		CANCEL_MENU(SYSTEM),
	OBJECT(NULL),
		TRANSLATE(OBJECT),
		DELETE(OBJECT),
		SELECT(OBJECT),
		MULTI_SELECT(OBJECT),
		MOVED(OBJECT),
		CLASS_BOX(OBJECT),
			SIMPLE(CLASS_BOX),
			ABSTRACT(CLASS_BOX),
			INTERFACE(CLASS_BOX),
			NOTE(CLASS_BOX),
			SIMPLE_ABSTRACT(CLASS_BOX),
			REPONSIBILITY_CLASS(CLASS_BOX),
			CLASS(CLASS_BOX),
		ANCHOR_POINT(OBJECT),
			ANCHOR(ANCHOR_POINT),
	FACTORY(NULL),
		ARROW_FACTORY(FACTORY),
			MAKE_ASSOCIATION(ARROW_FACTORY),
			MAKE_COMPOSITION(ARROW_FACTORY),
			MAKE_AGGREGATION(ARROW_FACTORY),
			MAKE_GENERALIZATION(ARROW_FACTORY),
			MAKE_ARROW_HEAD(ARROW_FACTORY),
			MAKE_ARREGATE_HEAD(ARROW_FACTORY),
	
		CLASS_FACTORY(FACTORY),
			MAKE_ABSTRACT (CLASS_FACTORY),
			MAKE_SIMPLE (CLASS_FACTORY),
			MAKE_SIMPLE_ABSTRACT (CLASS_FACTORY),
			MAKE_CLASS(CLASS_FACTORY),
			MAKE_INTERFACE(CLASS_FACTORY),
			MAKE_CIRCLE_INTERFACE(CLASS_FACTORY),
			MAKE_NOTE(CLASS_FACTORY),
			MAKE_PACKAGE(CLASS_FACTORY),
;
	
	private UMLEventId type = null;
	private UMLEventId(UMLEventId type)
	{
		this.type = type;
	}
	/**
	 * returns true if this or one of its parents is of type eventId
	 * @param eventId
	 * @return
	 */
	public boolean is(UMLEventId eventId)
	{
		if(type == null)
			return false;
		return eventId == type || type.is(eventId);
	}
	public UMLEventId getType()
	{
		return type;
	}
}
